// 车辆模拟数据
export const mockVehicles = [
  {
    id: '1',
    brand: '特斯拉',
    model: 'Model 3',
    year: 2023,
    licensePlate: '京A12345',
    vin: '5YJ3E1EA8PF000001',
    color: '白色',
    fuelType: '电动',
    transmissionType: '自动',
    engineCapacity: 0.0,
    vehicleType: '轿车',
    status: 'ACTIVE',
    mileage: 15000,
    registrationDate: new Date('2023-01-15').toISOString(),
    insuranceExpiry: new Date('2024-01-15').toISOString(),
    lastMaintenance: new Date('2023-11-01').toISOString(),
    ownerName: '张三',
    ownerPhone: '13800138000',
    ownerEmail: 'zhangsan@example.com',
    deviceId: 'DEV001',
    deviceSerialNumber: 'SN123456789',
    deviceModel: 'TeslaGuard V2.0',
    deviceVersion: '1.2.3',
    registrationNumber: '行驶证123456',
    insurancePolicyNumber: '保单789012',
    lastLatitude: 39.9042,
    lastLongitude: 116.4074,
    lastLocationUpdate: new Date().toISOString(),
    hasGPS: true,
    hasAlarm: true,
    hasImmobilizer: true,
    hasCamera: true,
    tags: ['电动车', '新车', '高配'],
    notes: '新车状态良好，配备完整安全系统',
    createdAt: new Date('2023-01-15').toISOString(),
    updatedAt: new Date().toISOString()
  },
  {
    id: '2',
    brand: '宝马',
    model: 'X5',
    year: 2023,
    licensePlate: '京B67890',
    vin: '5UX23EU00P9000001',
    color: '黑色',
    fuelType: '汽油',
    transmissionType: '自动',
    engineCapacity: 3.0,
    vehicleType: 'SUV',
    status: 'ACTIVE',
    mileage: 22000,
    registrationDate: new Date('2023-03-20').toISOString(),
    insuranceExpiry: new Date('2024-03-20').toISOString(),
    lastMaintenance: new Date('2023-12-15').toISOString(),
    ownerName: '李四',
    ownerPhone: '13900139000',
    ownerEmail: 'lisi@example.com',
    deviceId: 'DEV002',
    deviceSerialNumber: 'SN987654321',
    deviceModel: 'BMWSecure V1.5',
    deviceVersion: '1.1.8',
    registrationNumber: '行驶证654321',
    insurancePolicyNumber: '保单456789',
    lastLatitude: 39.8563,
    lastLongitude: 116.3770,
    lastLocationUpdate: new Date().toISOString(),
    hasGPS: true,
    hasAlarm: true,
    hasImmobilizer: false,
    hasCamera: true,
    tags: ['豪华SUV', '定期保养', '商务用车'],
    notes: '车况良好，定期保养',
    createdAt: new Date('2023-03-20').toISOString(),
    updatedAt: new Date().toISOString()
  },
  {
    id: '3',
    brand: '奔驰',
    model: 'GLC',
    year: 2023,
    licensePlate: '京C11111',
    vin: 'WDC0J4KB8PF000001',
    color: '银色',
    fuelType: '汽油',
    transmissionType: '自动',
    engineCapacity: 2.0,
    vehicleType: 'SUV',
    status: 'MAINTENANCE',
    mileage: 18000,
    registrationDate: new Date('2023-05-10').toISOString(),
    insuranceExpiry: new Date('2024-05-10').toISOString(),
    lastMaintenance: new Date('2023-12-20').toISOString(),
    ownerName: '王五',
    ownerPhone: '13700137000',
    ownerEmail: 'wangwu@example.com',
    deviceId: 'DEV003',
    deviceSerialNumber: 'SN333333333',
    deviceModel: 'MercedesSafe V2.1',
    deviceVersion: '1.0.5',
    registrationNumber: '行驶证111111',
    insurancePolicyNumber: '保单111222',
    lastLatitude: 39.9289,
    lastLongitude: 116.3883,
    lastLocationUpdate: new Date().toISOString(),
    hasGPS: true,
    hasAlarm: true,
    hasImmobilizer: true,
    hasCamera: true,
    tags: ['豪华SUV', '德国品质', '维修中'],
    notes: '正在进行定期保养和系统升级',
    createdAt: new Date('2023-05-10').toISOString(),
    updatedAt: new Date().toISOString()
  },
  {
    id: '4',
    brand: '丰田',
    model: '凯美瑞',
    year: 2023,
    licensePlate: '京D22222',
    vin: '4T1BF1FK8PU000001',
    color: '蓝色',
    fuelType: '汽油',
    transmissionType: 'CVT',
    engineCapacity: 2.5,
    vehicleType: '轿车',
    status: 'ACTIVE',
    mileage: 12000,
    registrationDate: new Date('2023-08-15').toISOString(),
    insuranceExpiry: new Date('2024-08-15').toISOString(),
    lastMaintenance: new Date('2023-12-01').toISOString(),
    ownerName: '赵六',
    ownerPhone: '13600136000',
    ownerEmail: 'zhaoliu@example.com',
    deviceId: 'DEV004',
    deviceSerialNumber: 'SN444444444',
    deviceModel: 'ToyotaSafe V1.8',
    deviceVersion: '1.3.0',
    registrationNumber: '行驶证222222',
    insurancePolicyNumber: '保单333444',
    lastLatitude: 39.9311,
    lastLongitude: 116.4074,
    lastLocationUpdate: new Date().toISOString(),
    hasGPS: true,
    hasAlarm: true,
    hasImmobilizer: false,
    hasCamera: true,
    tags: ['日系轿车', '经济实用', '省油'],
    notes: '日系经典轿车，省油耐用，保养及时',
    createdAt: new Date('2023-08-15').toISOString(),
    updatedAt: new Date().toISOString()
  },
  {
    id: '5',
    brand: '本田',
    model: '雅阁',
    year: 2023,
    licensePlate: '京E33333',
    vin: '1HGCV1F32PA000001',
    color: '红色',
    fuelType: '汽油',
    transmissionType: 'CVT',
    engineCapacity: 1.5,
    vehicleType: '轿车',
    status: 'INACTIVE',
    mileage: 25000,
    registrationDate: new Date('2023-02-28').toISOString(),
    insuranceExpiry: new Date('2024-02-28').toISOString(),
    lastMaintenance: new Date('2023-11-15').toISOString(),
    ownerName: '孙七',
    ownerPhone: '13500135000',
    ownerEmail: 'sunqi@example.com',
    deviceId: 'DEV005',
    deviceSerialNumber: 'SN555555555',
    deviceModel: 'HondaSafe V2.0',
    deviceVersion: '1.4.1',
    registrationNumber: '行驶证333333',
    insurancePolicyNumber: '保单555666',
    lastLatitude: 39.8563,
    lastLongitude: 116.3770,
    lastLocationUpdate: new Date().toISOString(),
    hasGPS: true,
    hasAlarm: false,
    hasImmobilizer: true,
    hasCamera: false,
    tags: ['日系轿车', '经济实用', '长期停用'],
    notes: '车辆长期停用，需要定期检查维护',
    createdAt: new Date('2023-02-28').toISOString(),
    updatedAt: new Date().toISOString()
  }
];

// 简化版的模拟数据（用于快速测试）
export const simpleMockVehicles = [
  {
    id: '1',
    brand: '特斯拉',
    model: 'Model 3',
    year: 2023,
    licensePlate: '京A12345',
    vin: '5YJ3E1EA8PF000001',
    color: '白色',
    status: 'ACTIVE',
    mileage: 15000,
    ownerName: '张三',
    ownerPhone: '13800138000'
  },
  {
    id: '2',
    brand: '宝马',
    model: 'X5',
    year: 2023,
    licensePlate: '京B67890',
    vin: '5UX23EU00P9000001',
    color: '黑色',
    status: 'ACTIVE',
    mileage: 22000,
    ownerName: '李四',
    ownerPhone: '13900139000'
  }
];

// 根据状态获取模拟数据
export const getMockVehiclesByStatus = (status) => {
  if (status === 'ALL') return mockVehicles;
  return mockVehicles.filter(vehicle => vehicle.status === status);
};

// 搜索模拟数据
export const searchMockVehicles = (query) => {
  if (!query) return mockVehicles;
  
  const lowerQuery = query.toLowerCase();
  return mockVehicles.filter(vehicle => 
    vehicle.vin?.toLowerCase().includes(lowerQuery) ||
    vehicle.licensePlate?.toLowerCase().includes(lowerQuery) ||
    vehicle.brand?.toLowerCase().includes(lowerQuery) ||
    vehicle.model?.toLowerCase().includes(lowerQuery) ||
    vehicle.ownerName?.toLowerCase().includes(lowerQuery)
  );
};